import * as types from "./mutation-types";
import vars from "@/styles/vars.scss";

const state = {
  sysTheme: vars.mainTheme
};

const getters = {
  sysTheme: state => state.sysTheme
};

const actions = {
  // 设置当前主题色
  set_theme ({commit}, theme) {
    commit(types.SET_THEME,theme)
  }
};

const mutations = {
  [types.SET_THEME](state, payload) {
    state.sysTheme = payload;
  }
};

export default {
  state,
  getters,
  actions,
  mutations
};
